import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

// import vuex modules
import user from './user'
import login from './login'
import header from './header'

const store = new Vuex.Store({
  state: {
    loading: false,
    logined: false
  },
  mutations: {
    UPDATE_LOADING (state) {
      state.loading = !state.loading
    },
    UPDATE_LOGINED (state) {
      state.logined = !state.logined
    }
  },
  modules: {
    user,
    login,
    header
  }
})

export default store
